<template>
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="button" data-toggle="tooltip" title="" onclick="$('#filter-customer').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg" data-original-title="筛选"><i class="fa fa-filter"></i></button>
                    <a href="http://kkc.cloud.com/admin/index.php?route=customer/customer/add&amp;user_token=0cfd8df4a55cee5e1fb9c135147feacb" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="添加"><i class="fa fa-plus"></i></a>
                    <button type="button" data-toggle="tooltip" title="" class="btn btn-danger" onclick="confirm('确认？') ? $('#form-customer').submit() : false;" data-original-title="删除"><i class="fa fa-trash-o"></i></button>
                </div>
                <h1>客户</h1>
                <ul class="breadcrumb">
                    <li><a href="http://kkc.cloud.com/admin/index.php?route=common/dashboard&amp;user_token=0cfd8df4a55cee5e1fb9c135147feacb">首页</a></li>
                    <li><a href="http://kkc.cloud.com/admin/index.php?route=customer/customer&amp;user_token=0cfd8df4a55cee5e1fb9c135147feacb">客户</a></li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row">
                <div id="filter-customer" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><i class="fa fa-filter"></i> 筛选过滤</h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="control-label" for="input-name">客户姓名</label> <input type="text" name="filter_name" value="" placeholder="客户姓名" id="input-name" class="form-control" autocomplete="off"><ul class="dropdown-menu" style="top: 133px; left: 31px; display: none;"><li data-value="1"><a href="#">cloud2</a></li></ul>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-email">E-Mail</label> <input type="text" name="filter_email" value="" placeholder="E-Mail" id="input-email" class="form-control" autocomplete="off"><ul class="dropdown-menu" style="top: 223px; left: 31px; display: none;"><li data-value="1"><a href="#">792724991@qq.com</a></li></ul>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-customer-group">客户等级</label> <select name="filter_customer_group_id" id="input-customer-group" class="form-control">
                                <option value=""></option>
                                <option value="1">普通用户组</option>
                            </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-status">状态</label> <select name="filter_status" id="input-status" class="form-control">
                                <option value=""></option>
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-ip">IP</label> <input type="text" name="filter_ip" value="" placeholder="IP" id="input-ip" class="form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-date-added">添加日期</label>
                                <div class="input-group date">
                                    <input type="text" name="filter_date_added" value="" placeholder="添加日期" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group text-right">
                                <button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> 筛选</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-9 col-md-pull-3 col-sm-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><i class="fa fa-list"></i> 客户列表</h3>
                        </div>
                        <div class="panel-body">
                            <form action="http://kkc.cloud.com/admin/index.php?route=customer/customer/delete&amp;user_token=0cfd8df4a55cee5e1fb9c135147feacb" method="post" enctype="multipart/form-data" id="form-customer">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').trigger('click');"></td>
                                            <td class="text-left"><a href="#" class="asc">客户姓名</a></td>
                                            <td class="text-left"><a href="#">电话</a></td>
                                            <td class="text-left"> <a href="#">客户等级</a></td>
                                            <td class="text-left"><a href="#">状态</a></td>
                                            <!--<td class="text-left"><a href="#">IP</a></td>-->
                                            <td class="text-left"><a href="#">添加日期</a></td>
                                            <td class="text-right">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="customer in customer_list">
                                            <td class="text-center">
                                                <input type="checkbox" name="selected[]" value="1">
                                            </td>
                                            <td class="text-left">{{customer.name}}</td>
                                            <td class="text-left">{{customer.telephone}}</td>
                                            <td class="text-left">{{customer.group_name}}</td>
                                            <td class="text-left">
                                                <span v-show="customer.status==1">启用</span>
                                                <span v-show="customer.status==0">禁用</span>
                                            </td>
                                            <!--<td class="text-left"></td>-->
                                            <td class="text-left">{{customer.create_time}}</td>
                                            <td class="text-right">
                                                <div class="btn-group" >
                                                    <a v-bind:href="'#/customer/customer/edit/' + customer.id" data-toggle="tooltip" title=""
                                                       class="btn btn-primary" data-original-title="编辑">
                                                        <i class="fa fa-pencil"></i>
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </form>
                            <div class="row">
                                <div class="col-sm-6 text-left"></div>
                                <div class="col-sm-6 text-right">显示 1 - 1 / 合计 1（共 1 页）</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {

        data:function(){
            return {
                customer_list:[]
            }
        },

        methods:{

            get_customer_list:function(){

                var url = this.config.web_url + '/admin.php?r=customer/customer/get_list';
                var t = this;

                this.axios.get( url ).then(function( res ){

                    t.customer_list = res.data;

                });

            }
        },

        created:function(){

            this.get_customer_list();
        }

    }
</script>

<style scoped>



</style>